#pragma once

#include "caAnalyseClient.h"

#define PARAM_MAX_COUNT 128

enum Call_CONV_TYPE
{
	STD_CALL_TYPE,
	CDECL_CALL_TYPE,
	THISCDECL_CALL_TYPE,
	THISSTD_CALL_TYPE
};

class caCCallFunMessage : public IMessage
{
	struct caSCallStack
	{
		size_t funAddr;
		DWORD callConv;
		LONGLONG retValue;
		PVOID callobj;
		DWORD paramSize;
		BYTE  params[1];
	}* m_sCallRFunParam;

	strstream* m_parambuf;
	DWORD m_dParamBaseSize;

public:
	caCCallFunMessage(size_t pFunAddr,DWORD uCallConv,PVOID obj);
	virtual ~caCCallFunMessage();

	virtual PVOID GetPartData();
	virtual DWORD GetPartSize();

	template<typename _type>
	BOOL PutParam(_type param);

	template<typename _type>
	BOOL GetParam(_type& param);

	LONGLONG GetReturnValue();

	virtual void  UndoPush();
};